$(function () {
    findNewsClassify();
})
function findNewsClassify() {
    let data = myAjax('/back/news/findNewsClassify','','get');
    data=data.model;
    let html='';
    for (let i=0;i<data.length;i++){
        html +=' <option value="'+data[i].id+'">' + data[i].classify + '</option>';
    };
    $("#newsClassify").html(html);
}
function submit() {
    let data1 = {
        newsClassify:$("#newsClassify").val(),
        title:$("#title").val(),
        content:$("#content").val(),
        contentall:$("#contentall").val(),
        newsTime:$("#newsTime").val(),
        author:$("#author").val(),
    };
    let data = myAjax('/back/news/addNews',data1,'post');
    if (data.result==1){
        alert("添加成功");
    }else {
        alert("添加失败");
    };
}